import 'package:flutter/material.dart';

class AppScaffold extends StatelessWidget {
  final Widget child;
  final Color? color;
  final BottomNavigationBar? bottomNavigationBar;
  bool? resizeToAvoidBottomInset;
  AppScaffold(
      {required this.child, this.color, this.bottomNavigationBar, this.resizeToAvoidBottomInset});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: this.color,
        body: child,
        resizeToAvoidBottomInset: resizeToAvoidBottomInset ?? false,
        bottomNavigationBar: bottomNavigationBar != null
            ? Theme(
                child: bottomNavigationBar!,
                data: ThemeData(
                  brightness: Brightness.light,
                  splashColor: Colors.transparent, //去除底部导航水波纹
                  highlightColor: Colors.transparent, //去除底部导航水波纹
                ))
            : null);
  }
}
